﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasertTemplates.Master" AutoEventWireup="true"  ValidateRequest="false" 
CodeBehind="Brand.aspx.cs" Inherits="WebApplication.Brand" %>
<%@ Register TagPrefix="uc1" TagName="usermeg" Src="~/UserControl/UserMessageControl.ascx" %>
<%@ Register TagPrefix="uc1" TagName="maintab" Src="~/UserControl/MainTabControl.ascx" %>
<%@ Import  Namespace="HKEA.CMS.Core.Utility" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<script type="text/javascript" src="Media/AjaxJs/Brand.js"></script>
<script type="text/javascript" src="Media/Js/JScriptVariable.js"></script>
<script type="text/javascript" src="xhEditor/xheditor-zh-cn.min.js"></script>
<script type="text/javascript" src="Media/Js/BankScript.js"></script>
<script type="text/javascript" src="Media/Js/jquery.lightbox-0.5.js"></script>
    <link href="Media/Css/jquery.lightbox-0.5.css" rel="Stylesheet" />
    <link href="media/js/jquery.uploadify-v2.1.4/uploadify.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="media/js/jquery.uploadify-v2.1.4/swfobject.js"></script>
    <script type="text/javascript" src="media/js/jquery.uploadify-v2.1.4/jquery.uploadify.v2.1.4.min.js"></script>
<script language="javascript" type="text/javascript">
    $(pageInit);
    function pageInit() {
        $('#ContentPlaceHolder2_txtBrandIntro_Chi').xheditor({ skin: 'o2007blue', tools: 'full'
            //tools: 'Cut,Copy,Paste,Pastetext,|,Blocktag,Fontface,FontSize,Bold,Italic,Underline,Strikethrough,FontColor,BackColor,SelectAll,Removeformat,|,Align,List,Outdent,Indent,|,Link,Unlink,Img,Flash,Media,Table,|,Source,Preview,Fullscreen,About'
        });
        $('#ContentPlaceHolder2_txtBrandIntro_Eng').xheditor({ skin: 'o2007blue', tools: 'full'
            //tools: 'Cut,Copy,Paste,Pastetext,|,Blocktag,Fontface,FontSize,Bold,Italic,Underline,Strikethrough,FontColor,BackColor,SelectAll,Removeformat,|,Align,List,Outdent,Indent,|,Link,Unlink,Img,Flash,Media,Table,|,Source,Preview,Fullscreen,About'
        });
    }

        function choice_pic() {
            if ($("#ContentPlaceHolder2_hidAllowToOption").attr("value") != "false") {
                $('#uploadify').uploadifyUpload();
            }
            else {
                $(".italic").html("<span class=\"clsWarningMeg\">操作失败,因为该数据不存在.</span>");
            }
        }

        $(document).ready(function () {
            if ($("#ContentPlaceHolder2_lkAdd").attr("href") != null) {
                $(".LiOFAdd").removeAttr("onClick");
            }

            $("#LiOfQuitAdd").click(function () {
                if ($("#ContentPlaceHolder2_lkAdd").attr("href") != null) {
                    $("#ContentPlaceHolder2_lkBtnSave").addClass("aspNetDisabled");
                }
            });

            var type = '<%=type %>';
            if (type == "add") {
                AddBrand();
            }
        });
        

</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
  <input type="hidden" value="t21" id="pageName" />
 <div class="content-title"><h1>Customer - Brand</h1></div> 
         <div class="con-nav"><a href="#" class="btn"><span class="ui-icon ui-icon-newwin"></span>Add New Customer</a></div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
<uc1:usermeg ID="usermeg" runat="server" ></uc1:usermeg>        
    <div class="partWrap">
    <uc1:maintab ID="maintab"  runat="server"/> 
    <div class="clear20"></div>
	  <ul class="uibtn">
      <li class="LiOFAdd" onClick="javascript:AddBrand();"><span><asp:HyperLink ID="lkAdd" runat="server">Add Brand</asp:HyperLink></span></li>
	</ul>
	<div class="wrapToggle" id="wrapToggle">
	<table  cellspacing="0" cellpadding="0" width="500">	
	<tr>
	<td><p class="upinput">Brand Name</p>
        <asp:TextBox ID="txtBrandName_Eng" CssClass="input200" runat="server"></asp:TextBox>
	</td>
    </tr>
   
     <tr>
	<td><p class="upinput">Brand Description</p>
        <asp:TextBox ID="txtBrandIntro_Eng" TextMode="MultiLine" CssClass="textarea800" runat="server"></asp:TextBox>
	</td>
	</tr>
    <tr>
	<td><p class="upinput">品牌名稱</p>
        <asp:TextBox ID="txtBrandName_Chi" CssClass="input200" runat="server"></asp:TextBox>
	</td>
	</tr>
    <tr>
	<td><p class="upinput">品牌簡介</p>
	<asp:TextBox ID="txtBrandIntro_Chi" TextMode="MultiLine" CssClass="textarea800" runat="server"></asp:TextBox>
	</td>
	</tr>
	</table>		
	<div class="clear20"></div>
	<table width="500">
	<tr>
	 <td valign="top" ><div class="addWrap"> 
	  <ul class="uibtn">
    	<li onClick="javascript:AddImg()"><span>Add Brand Image</span></li>
	  </ul>	 
	 <div class="smallImgList" id="smallImgList2" style="bottom:-200px;">	
	<table width="100%">
	<tr>
	<td  align="right"> <img class="delete closeBtn" src="Media/Css/images/del-form.png" onClick="CloseDocument('smallImgList2')"></td>
	</tr>
	<tr>
	 <td><h5>Choose from Media Room</h5></td>
	</tr>
	<tr>
	<td>	
	 <div class="imgQu">
     <asp:UpdatePanel ID="UpdatePanel4" runat="server" UpdateMode="Conditional">
    <ContentTemplate>
	 <ul class="slist">
         <asp:Repeater ID="rptImgList" runat="server"   ViewStateMode="Disabled">
         <ItemTemplate>
         <li><span class="clssmallimglist" onclick="ToRelated(this)"><asp:Image ID="imgMedia" runat="server" CssClass='<%#Eval("MediaRoomUID") %>' ImageUrl='<%#JoinPath(Eval("FilePath"),Eval("FileName"),"_50_50",".jpg") %>'  AlternateText='<%#Eval("FileName") %>'/></span></li>
         </ItemTemplate>
         </asp:Repeater>
	 </ul>
     </ContentTemplate>
     <Triggers><asp:AsyncPostBackTrigger ControlID="btnRefreshImgList" EventName="Click" /></Triggers>
     </asp:UpdatePanel>
        <div class="clsNoDisplay">
        <asp:Button ID="btnRefreshImgList" runat="server" onclick="btnRefreshImgList_Click"/>
        <asp:Button ID="btnRefreshBrandList" runat="server" onclick="btnRefreshBrandList_Click"/>
        </div>
	 </div>
	</td>
	</tr>
	<tr>
	<td height="35"><a href="#">Upload image from your computer </a>
    <div id="fileQueue"></div>
    <input type="file" name="uploadify" id="uploadify" /><br />
    <span id="id_message" style="background-color: #ffc; color: Red;"></span>
    <asp:HiddenField ID="hfupload_pic" runat="server" />
    </td>
	</tr>
     <tr>
    <td>
    <p class="red italic">Photo Specifications: Full Size 200pix(W) x 120pix(H); Format JPEG, BMP; File Size: 100KB
</p>
    </td>
    </tr>

	<tr>

	<td height="35">
    <table  border="0" cellspacing="0" cellpadding="0" class="btnwrap">
			  <tr>
				<td  class="btnwrapl">
				 <ul class="uibtn">
    	              <li><a id="id_choice_pic" onclick="choice_pic()">UpLoad</a></li>
	             </ul>
				</td>
				<td class="btnwrapr">
				 <ul class="uibtn">
    	           <li ><a id="coloseImgList" onclick ="CloseDocument('smallImgList2')">Quit</a></li>
	              </ul>
				</td>
                <td >
                </td>				
			  </tr>
			</table>	 </td>
	</tr>
	</table>
	 </div>
	 </div></td>
	</tr>
	</table>	

	<asp:UpdatePanel ID="UpdatePanel3" runat="server"  UpdateMode="Conditional">
            <ContentTemplate>  
		        <ul class="ImgList"> 
                    <asp:Repeater ID="rptRelatedImgList" runat="server"   ViewStateMode="Disabled">
                    <ItemTemplate>
		            <li class='<%#Eval("MediaRoomUID")%>'>
		                <p class="p2"><img src='<%# Eval("FilePath").ToString() + Eval("FileName").ToString() %>_150_150.jpg' /></p>
                        <div class="p4">
                            <span class="showbig" onclick="EditImgRelated(this)">Edit</span> | 
                            <span class="closeBtnbig" onclick="DeleteRelated(this)">Delete</span>
                        </div>
		            </li>
                    </ItemTemplate>
		            </asp:Repeater>
		        </ul>
                <asp:HiddenField ID="hidMediaRoomUID" runat="server" />
            </ContentTemplate>
            <Triggers><asp:AsyncPostBackTrigger ControlID="lkBtnSave" EventName="Click" /></Triggers>
            </asp:UpdatePanel>
	<div  class="clear20"></div>



	<div class="productWrap">
	<div class="productTitle"></div>
	<div class="CheckWrap">
	<ul class="menu1_ul menu1" id="menu1_ul1">
	  <li class="li1" id="menu_ul_A"><div  class="selected" style="display:none;" >√</div><span>Textile & Garment</span></li>
	  <li class="li2" id="menu_ul_B"><div  class="selected" style="display:none;" >√</div><span>Electronics, AV & IT</span></li>
	  <li class="li3" id="menu_ul_C"><div  class="selected" style="display:none;">√</div><span>Houseware</span></li>
	  <li class="li4" id="menu_ul_D"><div  class="selected" style="display:none;" >√</div><span>Gifts & Premium</span></li>
	  <li class="li5" id="menu_ul_E"><div  class="selected" style="display:none;" >√</div><span>Others</span></li>
  </ul>
  	
	<h4  class="title20">Main Category</h4>
        <asp:Repeater ID="rptStart" runat="server" OnItemDataBound="rptStart_ItemDataBound" ViewStateMode="Disabled">
            <ItemTemplate>
              <div id='startwith_<%#DataBinder.Eval(Container.DataItem,"startwith")%>' class="clsAllcheck" style="display:none;">
                <p ><input id='<%#DataBinder.Eval(Container.DataItem,"startwith")%>' type="checkbox" class="clsckbAll" /><label for='<%#DataBinder.Eval(Container.DataItem,"startwith")%>'><strong>ALL</strong></label></p>
                <ul id='cat_<%#DataBinder.Eval(Container.DataItem,"startwith")%>' class="clsulList">
                    <asp:Repeater ID="rptCat" runat="server"   ViewStateMode="Disabled">
                    <ItemTemplate>
                        <li><input id='ckb_cat_<%# Eval("ProductCatUID")%>' class="ckb_cat" type="checkbox" value='<%# Eval("ProductCatUID")%>' /><label for='ckb_cat_<%# Eval("ProductCatUID")%>'><%# Eval("ProductCat_Eng")+" "+ Eval("ProductCat_Chi")%></label></li>
                    </ItemTemplate>
                    </asp:Repeater>
                </ul>
                <div class="clear20"></div>
                <asp:Repeater ID="rptCatForSubCat" runat="server" OnItemDataBound="rptCatForSubCat_ItemDataBound"  ViewStateMode="Disabled">
                <ItemTemplate>
                    <p><strong><%# Eval("ProductCat_Eng")+" "+ Eval("ProductCat_Chi")%></strong></p>
                    <ul id='ul_cat_<%# Eval("ProductCatUID")%>' class="clsulList">
                        <asp:Repeater ID="rptSubCat" runat="server"  ViewStateMode="Disabled">
                        <ItemTemplate>
                        <li><input id='ckb_subcat_<%# Eval("ProductSubCatUID")%>' class="ckb_subcat" value='<%# Eval("ProductSubCatUID")%>' type="checkbox" /><label for='ckb_subcat_<%# Eval("ProductSubCatUID")%>'><%# Eval("ProductSubCat_Eng")+" "+Eval("ProductSubCat_Chi")%></label></li>
                        </ItemTemplate>
                        </asp:Repeater>
                    </ul>
                    <div class="clear20"></div>
                </ItemTemplate>
                </asp:Repeater>
            </div>
            </ItemTemplate>
        </asp:Repeater>
	</div>
</div>	
<div class="clear20"></div>
<table  border="0" cellspacing="0" cellpadding="0" class="btnwrap">
			  <tr>
				<td>
				 <ul class="uibtn">
    	              <li>
                          <asp:LinkButton ID="lkBtnSave" OnClientClick="return GetCatInfo()"  onclick="lkBtnSave_Click" runat="server">Save</asp:LinkButton>
                          </li>
	             </ul>
				</td>
				<td>
				 <ul class="uibtn">
    	           <li class="LiOFAdd" id="LiOfQuitAdd"  onClick="javascript:QuitToAdd();"><span><asp:HyperLink ID="lkQuit" runat="server">Quit</asp:HyperLink></span></li>
	              </ul>
				</td>
                <td >
                </td>				
			  </tr>
              <tr>
              <td colspan="3">
                  <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
                  <ContentTemplate>
                <asp:Label ID="lblMeg" runat="server" CssClass="clsWarningMeg"></asp:Label>
                <asp:HiddenField ID="hidRelatedBrandProdCatStrUID" runat="server" />
                </ContentTemplate>
                <Triggers><asp:AsyncPostBackTrigger ControlID="lkBtnSave" EventName="Click" /></Triggers>
                  </asp:UpdatePanel>
              </td>
              </tr>
              </table>
            </div>
	<div class="clear20"></div>		
<div class="bankwrap">
    <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <asp:Repeater ID="rptBrandList" runat="server" ViewStateMode="Disabled">
                <ItemTemplate>
                    	<div class="tb-wrap round" id="list_<%# Eval("BrandUID") %>">	
	                    <div class="tb-top round">	
                        <div class="editBox">
	                    <span id="search-btn0" class="tb-slide" onclick="tbSlideClick(this,'<%# Container.ItemIndex %>')">&nbsp;</span>
                        <a href='Brand.aspx?<%#Constant.UrlParamName.CustomerUID%>=<%# Eval("CustomerUID") %>&<%#Constant.UrlParamName.BrandUID%>=<%# Eval("BrandUID") %>'>Edit</a>
                        <span class="slplit"> | </span>
                        <a  href="javascript:delete_confirms('DeleteBox_<%# Eval("BrandUID") %>','DeleteBrand',this)">Delete</a>
	                    <span class="slplit"> | </span> 
                        </div>
                        </div>
	                    <div class="tb-cont">
	                     <table width="500" border="0" cellspacing="0" cellpadding="0" class="tab-list-table">
	                      <tr>
		                    <td width="100" class="tleft">Brand Name</td>
		                    <td width="2">&nbsp;</td>
		                    <td width="388"><%# Eval("BrandName")%></td>
	                      </tr>
	                      <tr>
		                    <td class="tleft">Product Category</td>
		                    <td>&nbsp;</td>
		                    <td><%# Eval("strCat")%></td>
	                      </tr>	  	 
	                    </table>	
	                    </div>
                        </div>
                </ItemTemplate>
            </asp:Repeater>
        </ContentTemplate>
        <Triggers><asp:AsyncPostBackTrigger ControlID="lkBtnSave" EventName="Click" /></Triggers>
        <Triggers><asp:AsyncPostBackTrigger  ControlID="btnRefreshBrandList" EventName="Click"/></Triggers>
    </asp:UpdatePanel>
    <div class="clear10"></div>

 <div id="DeleteBox" class="Popconfirms">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td align="center">
	
	<div class="Poptxt">Are you sure to delete?</div></td>  
    
  </tr>
  <tr>
    <td align="center"><span id="sureMeg" class="clsWarningMeg"></span>
	<div class="clear20"></div>
	<table>
	<tr>
    <td>
	 <ul class="uibtn">
    	<li onclick="SureDelete()" ><span>Sure</span></li>
	</ul>
	</td>
	<td width="10"></td>
    <td>
	 <ul class="uibtn">
    	<li onclick="CloseDelete()" ><span>Quit</span></li>
	</ul>
	</td>
	</tr>
	</table>
	</td>
  </tr>
</table>
</div>


</div>
</div>
    <input id="hidAddImgType" type="hidden" />
    <asp:HiddenField ID="hidAllowOption" Value="true" runat="server" />
    <asp:HiddenField ID="hidCustomerUID" runat="server" />
    <asp:HiddenField ID="hidBrandUID" runat="server" />
    <asp:HiddenField ID="hidRelatedNeedToDelete" runat="server" />
    <asp:HiddenField ID="hidRelatedNeedToAdd" runat="server" />
</asp:Content>
